import { useRoutes } from "react-router-dom";

export const useSetupRouterTitleGuard = (routes) => {
  const curRoute = useRoutes(routes).props.match.route;

  document.title = curRoute.meta?.title ?? process.env.REACT_APP_TITLE;
};
